
:root {
    --bg: #111111;
    --container-width: 10rem;
    --container-height: 6.25rem;
}

body {
  text-align: center;
  padding: 4rem 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.container-carousel {
  margin: 0 auto;
  width: var(--container-width);
  height: var(--container-height);
  perspective: 1000px;
}

.carousel {
  --rotatey: 0;
  font-size: 4rem;
  position: relative;
  transform: rotatey(var(--rotatey));
  transform-style: preserve-3d;
  user-select: none;
  cursor: grab;
}

.carousel-item {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.3125rem;
  transition: opacity 0.5s;
}

.carousel-item img {
    display: block;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel,
.carousel-item {
  width: 100%;
  height: 100%;
}

.carousel-item:nth-child(1) {
  --rotatey: 0;
  transform: rotatey(var(--rotatey)) translatez(var(--tz));
}

.carousel-item:nth-child(2) {
  --rotatey: 0;
  transform: rotatey(var(--rotatey)) translatez(var(--tz));
}

.carousel-item:nth-child(3) {
  --rotatey: 0;
  transform: rotatey(var(--rotatey)) translatez(var(--tz));
}
.carousel-item:nth-child(4) {
  --rotatey: 0;
  transform: rotatey(var(--rotatey)) translatez(var(--tz));
}

.carousel-item:nth-child(5) {
  --rotate: 0;
  transform: rotatey(var(--rotatey)) translatez(var(--tz));
}

.carousel-item:nth-child(6) {
  --rotatey: 0;
  transform: rotatey(var(--rotatey)) translatez(var(--tz));
}

@media screen and (min-width: 576px) {
  .container-carousel {
    --widthItem: 16rem;
    --heightItem: 12.5rem;
  }
}